package com.huabo.contract.oracle.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.contract.oracle.entity.TblLegalNegotiaterecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-03-18
 */
public interface TblLegalNegotiaterecordMapper extends BaseMapper<TblLegalNegotiaterecord> {


    @Select("SELECT * FROM TBL_LEGAL_NEGOTIATERECORD WHERE NEGOTIATEINFO = #{negotiaId}")
    List<TblLegalNegotiaterecord> findListBynegotiaId(Integer negotiaId);

    @InsertProvider(type=TblLegalNegotiaterecordMapperSqlConfig.class,method="saveNegotiateRecord")
    @Options(useGeneratedKeys=true, keyProperty="recordid", keyColumn="RECORDID")
    void saveNegotiateRecord(TblLegalNegotiaterecord record);

    @Select("SELECT * FROM TBL_LEGAL_NEGOTIATERECORD WHERE RECORDID = #{recordId}")
    TblLegalNegotiaterecord findById(Integer recordId);

    @UpdateProvider(type=TblLegalNegotiaterecordMapperSqlConfig.class,method="updateModifyNegotiateRecord")
    void updateModifyNegotiateRecord(TblLegalNegotiaterecord oldRecord);

    @Delete("DELETE FROM TBL_LEGAL_NEGOTIATERECORD WHERE RECORDID = #{recordId}")
    void removeNegitiateRecord(Integer recordId);

    @SelectProvider(type=TblLegalNegotiaterecordMapperSqlConfig.class,method="findByNegotiaid")
    List<TblLegalNegotiaterecord> findByNegotiaid(PageInfo<TblLegalNegotiaterecord> pageInfo, Integer negotiaId);

    @SelectProvider(type=TblLegalNegotiaterecordMapperSqlConfig.class,method="findByNegotiaidCount")
    Integer findByNegotiaidCount(Integer negotiaId);
}
